// var arr = {
//     name: '小明',
//     birth: 2035,
//     age: function () {
//         console.log(this);
//         return new Date().getFullYear();
//     }
// };
// console.log(arr.age());
'use strict'
// let ger ={
//     name1 :'敦煌',
//     birth1:2000,
//     age1:function(){
//         var dd = new Date().getFullYear();
//         return dd - this.birth1;
//     }
// };
// console.log(ger.age1());

var txt ={
    name:'叫啥子哦',
    birth:20,
    age:function(){
        let that =this;
        function getAgeFromBirth() {
            var g = new Date().getFullYear();
            return g - that.birth; 
        }
        return getAgeFromBirth();
    }
};

console.log(txt.age());


function ge() {
    var i = new Date().getFullYear();
    return i - this.birth;//this>>>huang
}

var huang = {
    name: '字母哥',
    birth: 2005,
    age: ge
};

console.log(huang);
console.log(huang.age());
console.log(ge.apply(huang, []));
console.log(ge.call(huang,[]));
